# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-cx_oracle
_pkgname=cx_Oracle
pkgver=8.3.0
pkgrel=1
pkgdesc='Python interface to Oracle.'
arch=('x86_64' 'aarch64')
url='https://pypi.org/project/cx_Oracle/#files'
license=('BSD')
depends=('python')
makedepends=('python-setuptools' 'python-pip' 'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('9a2f50b929802311271e5270f118c96968886c6fd3c8677d2e08949d61e9d4d26846bc9e44c674e0bd12a7f8b57bcced9b979f3622a37656e0969ad8ea4e7f70')

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  install -dm 755 "$pkgdir/usr/share/"{doc,"licenses/$pkgname"}

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/$_pkgname-doc" "$pkgdir/usr/share/doc/$pkgname/"
  mv "$pkgdir/usr/share/doc/$pkgname/LICENSE.txt" \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

